<html  xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8" />
    <script type="text/javascript" src="static/js/jquery-1.10.2.min.js" th:src="@{/static/js/jquery-1.10.2.min.js}" ></script>

    <script th:inline="javascript">
        $(function(){
            var _ctx = [[${application.ctx}]];
            alert("Project ContextPath:"+_ctx);
            alert("路径:"+$("#ctx").val());
        });
    </script>
    <title>Spring MVC + Thymeleaf Example</title>
</head>
<body>
<!-- Project ContextPath -->
<input type="hidden" id="ctx" th:value="${application.ctx}" /> Hello,
<span th:text="${name}" />!
<br /> Hello,
<span th:text="${query}" />!
<br /> Hello,
<span th:text="${submit}" />!
<br />
<a th:href="@{/query?name=a_href}"> query</a>
<br />
<form th:action="@{/submit}">
    <input type="text" name="name" />
    <button type="submit">submit</button>
</form>

</body>
</html>